package http

import (
	"multimedia/service"

	"github.com/gin-gonic/gin"
)

func InitRouting(c *gin.Engine) {
	{
		c.POST("/management/apps/:appId/meetings/:meetId/evt", service.DataSrv.MediaCallBack)
		c.POST("/easemob-demo/chatdemoui/whiteboards/webm/start", service.DataSrv.WhiteBoardRecordStart)
		c.POST("/easemob-demo/chatdemoui/whiteboards/webm/stop", service.DataSrv.WhiteBoardRecordstop)
	}
	TotalGroup := c.Group("/videochat")
	{
		TotalGroup.GET("/getVSCodeForSlider", service.DataSrv.VerificationCodeForSlider)
		TotalGroup.GET("/getVSCode", service.DataSrv.GetVSCode)
		TotalGroup.GET("/getVSCodeNew", service.DataSrv.NewGetVSCode)
		TotalGroup.GET("/register", service.DataSrv.Register)
		TotalGroup.GET("/login", service.DataSrv.Login)
		TotalGroup.GET("/updateToken", service.DataSrv.UpdateToken)
		TotalGroup.GET("/logout", service.DataSrv.Logout)
		TotalGroup.POST("/newlogin", service.DataSrv.NewLogin)
		TotalGroup.POST("/telVsCodeReq", service.DataSrv.TelVsCodeReq)
		TotalGroup.POST("/modifyPassword", service.DataSrv.ModifyPassword)
	}
	EmediaGroup := TotalGroup.Group("/emedia")
	{
		EmediaGroup.Use(service.DataSrv.CheckToken)
		EmediaGroup.GET("/enter_room", service.DataSrv.EnterRoom)
	}

	UserGroup := TotalGroup.Group("/user")
	{
		UserGroup.Use(service.DataSrv.CheckToken)
		UserGroup.GET("/info", service.DataSrv.GetUserInfo)
		UserGroup.GET("/editNickname", service.DataSrv.EditUserNickname)
		UserGroup.POST("/avatarUpload", service.DataSrv.AvatarUpload)
		UserGroup.POST("/avatarCircularUpload", service.DataSrv.AvatarCircularUpload)
		UserGroup.GET("/getUserSig", service.DataSrv.GetUserSig)
	}
	ConferGroup := TotalGroup.Group("/conference")
	{
		ConferGroup.Use(service.DataSrv.CheckToken)
		ConferGroup.POST("/create", service.DataSrv.AddConferenceInfo)
		ConferGroup.GET("/list", service.DataSrv.GetConferenceList)
		ConferGroup.POST("/edit", service.DataSrv.EditConferenceInfo)
		ConferGroup.GET("/delete", service.DataSrv.DeleteConferenceInfo)
		ConferGroup.POST("/batchDeleteIndivRecord", service.DataSrv.BatchDeleteIndivRecord)
		ConferGroup.GET("/cycleRule", service.DataSrv.GetCycleRuleByGroupId)
		ConferGroup.GET("/incomingCheck", service.DataSrv.IncomingCheck)
		ConferGroup.GET("/hisConfList", service.DataSrv.GetHisConfList)
		ConferGroup.GET("/hisConfDetail", service.DataSrv.GetHisConfDetail)
		ConferGroup.GET("/deleteRecord", service.DataSrv.DeleteConferenceRecord)
		ConferGroup.GET("/editConfeRecordFlag", service.DataSrv.EditConfeRecordFlag)
	}
	TidingsGroup := TotalGroup.Group("/tidings")
	{
		TidingsGroup.Use(service.DataSrv.CheckToken)
		TidingsGroup.GET("/info", service.DataSrv.GetTidingsInfo)
		TidingsGroup.GET("/list", service.DataSrv.GetTidingsList)
		TidingsGroup.POST("/updateView", service.DataSrv.UpdateView)
		TidingsGroup.POST("/delete", service.DataSrv.DeleteTidingsInfo)
	}
	settingGroup := TotalGroup.Group("/setting")
	{
		settingGroup.Use(service.DataSrv.CheckToken)
		settingGroup.GET("/info", service.DataSrv.GetPersonalSettings)
		settingGroup.GET("/edit", service.DataSrv.ModifySettings)
	}
	fsClient := TotalGroup.Group("/fscontrol")
	{
		fsClient.Use(service.DataSrv.CheckToken)
		fsClient.POST("/contorlmsg", service.DataSrv.Contorlmsg)
		fsClient.POST("/singleContorl", service.DataSrv.FSContorl)
		fsClient.GET("/startRecord", service.DataSrv.StartRecord)
	}
	{
		c.POST("/v1/Admin/FreeSwitch/postSendSyncApiCommand", service.DataSrv.SyncApiCommand)
		c.POST("/v1/SendMsg", service.DataSrv.SendMsg)
	}
}
